home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / sun / applet / AppletViewerPanel.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  2.5 KB  |  109 lines

  1. package sun.applet;
  2.  
  3. import java.applet.AppletContext;
  4. import java.net.MalformedURLException;
  5. import java.net.URL;
  6. import java.util.Hashtable;
  7.  
  8. class AppletViewerPanel extends AppletPanel {
  9.    static boolean debug = false;
  10.    URL documentURL;
  11.    URL baseURL;
  12.    Hashtable atts;
  13.    private static final long serialVersionUID = 8890989370785545619L;
  14.  
  15.    AppletViewerPanel(URL var1, Hashtable var2) {
  16.       this.documentURL = var1;
  17.       this.atts = var2;
  18.       String var3 = this.getParameter("codebase");
  19.       if (var3 != null) {
  20.          if (!var3.endsWith("/")) {
  21.             var3 = var3 + "/";
  22.          }
  23.  
  24.          try {
  25.             this.baseURL = new URL(var1, var3);
  26.          } catch (MalformedURLException var8) {
  27.          }
  28.       }
  29.  
  30.       if (this.baseURL == null) {
  31.          String var4 = var1.getFile();
  32.          int var5 = var4.lastIndexOf(47);
  33.          if (var5 >= 0 && var5 < var4.length() - 1) {
  34.             try {
  35.                this.baseURL = new URL(var1, var4.substring(0, var5 + 1));
  36.             } catch (MalformedURLException var7) {
  37.             }
  38.          }
  39.       }
  40.  
  41.       if (this.baseURL == null) {
  42.          this.baseURL = var1;
  43.       }
  44.  
  45.    }
  46.  
  47.    public String getParameter(String var1) {
  48.       return (String)this.atts.get(var1.toLowerCase());
  49.    }
  50.  
  51.    public URL getDocumentBase() {
  52.       return this.documentURL;
  53.    }
  54.  
  55.    public URL getCodeBase() {
  56.       return this.baseURL;
  57.    }
  58.  
  59.    public int getWidth() {
  60.       String var1 = this.getParameter("width");
  61.       return var1 != null ? Integer.valueOf(var1) : 0;
  62.    }
  63.  
  64.    public int getHeight() {
  65.       String var1 = this.getParameter("height");
  66.       return var1 != null ? Integer.valueOf(var1) : 0;
  67.    }
  68.  
  69.    public boolean hasInitialFocus() {
  70.       if (!this.isJDK11Applet() && !this.isJDK12Applet()) {
  71.          String var1 = this.getParameter("initial_focus");
  72.          return var1 == null || !var1.toLowerCase().equals("false");
  73.       } else {
  74.          return false;
  75.       }
  76.    }
  77.  
  78.    public String getCode() {
  79.       return this.getParameter("code");
  80.    }
  81.  
  82.    public String getJarFiles() {
  83.       return this.getParameter("archive");
  84.    }
  85.  
  86.    public String getSerializedObject() {
  87.       return this.getParameter("object");
  88.    }
  89.  
  90.    public AppletContext getAppletContext() {
  91.       return (AppletContext)this.getParent();
  92.    }
  93.  
  94.    static void debug(String var0) {
  95.       if (debug) {
  96.          System.err.println("AppletViewerPanel:::" + var0);
  97.       }
  98.  
  99.    }
  100.  
  101.    static void debug(String var0, Throwable var1) {
  102.       if (debug) {
  103.          var1.printStackTrace();
  104.          debug(var0);
  105.       }
  106.  
  107.    }
  108. }
  109.